<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>新用户注册 | BoPress</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link href="{{static_url('theme/bootstrap/css/bootstrap.min.css')}}" rel="stylesheet">
    <!-- Font Awesome -->
    <link href="{{static_url('theme/font-awesome/css/font-awesome.min.css')}}" rel="stylesheet">
    <!-- Ionicons -->
    <link href="{{static_url('theme/ionicons2/css/ionicons.min.css')}}" rel="stylesheet">
    <!-- Theme style -->
    <link href="{{static_url('theme/css/AdminLTE.min.css')}}" rel="stylesheet">
    <!-- iCheck -->
    <link href="{{static_url('theme/plugins/iCheck/square/blue.css')}}" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="{{static_url('js/html5shiv.min.js')}}"></script>
    <script src="{{static_url('js/respond.min.js')}}"></script>
  <![endif]-->
    <style type="text/css">
        body,
        table,
        input,
        textarea,
        select,
        button,
        a,
        p,
        h1,
        h2,
        h3,
        h4,
        h5,
        div {
            font-family: "Microsoft YaHei", Verdana, sans-serif, "SimSun";
        }
    </style>
</head>

<body class="hold-transition register-page">
    <div class="register-box">
        <div class="register-logo">
            <a href="../../index2.html"><b>Bo</b>Press</a>
        </div>

        <div class="register-box-body">
            <form action="{{reverse_url('registry')}}" method="post" id="registry-form">
                <div class="form-group has-feedback">
                    <input type="email" class="form-control" name="user_email" placeholder="邮箱">
                    <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
                </div>
                <div class="form-group has-feedback">
                    <input type="password" class="form-control" name="user_pass" placeholder="密码">
                    <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                </div>
                <div class="form-group has-feedback">
                    <input type="password" class="form-control" name="user_re_pass" placeholder="重复密码">
                    <span class="glyphicon glyphicon-log-in form-control-feedback"></span>
                </div>
                <div id="registry_info"></div>
                <div class="row">
                    <div class="col-xs-8">
                        <div class="checkbox icheck">
                            <label>
              <input type="checkbox"> 我同意 <a href="#">条款</a>
            </label>
                        </div>
                    </div>
                    <!-- /.col -->
                    <div class="col-xs-4">
                        <button type="button" class="btn btn-primary btn-block btn-flat" onclick="registry_func();">注册</button>
                    </div>
                    <!-- /.col -->
                </div>
            </form>
            <a href="{{reverse_url('login')}}" class="text-center">我有账号</a>
        </div>
        <!-- /.form-box -->
    </div>
    <!-- /.register-box -->

    <!-- jQuery 2.2.3 -->
    <script src="{{static_url('theme/plugins/jQuery/jquery-2.2.3.min.js')}}"></script>
    <!-- Bootstrap 3.3.6 -->
    <script src="{{static_url('theme/bootstrap/js/bootstrap.min.js')}}"></script>
    <!-- iCheck -->
    <script src="{{static_url('theme/plugins/iCheck/icheck.min.js')}}"></script>
    <script src="{{static_url('js/bo-alert.js')}}"></script>
    <script>
        function go(secs, surl) {
            document.getElementById("time_label").innerText = secs;
            if (--secs > 0) {
                setTimeout("go(" + secs + ",'" + surl + "')", 1000); //设定超时时间
            } else {
                location.href = surl; //跳转页面
            }
        }
        function registry_func() {
            $.post("{{reverse_url('registry')}}", $("#registry-form").serialize(), function(rsp) {
                if (rsp.success) {
                    $("#registry_info").html("注册成功，一封激活邮件已经发送到您的邮箱! <span id='time_label' style='color:red;'></span>");
                    go(3, '{{reverse_url("login")}}');
                } else {
                    bo_valid_errors("registry-form", rsp.data, rsp.message);
                }
            }, "json");
        }
        $(function() {
            $('input').iCheck({
                checkboxClass: 'icheckbox_square-blue',
                radioClass: 'iradio_square-blue',
                increaseArea: '20%' // optional
            });
        });
    </script>
</body>

</html>